#include <iostream>
using namespace std;

class CShape {
public:
	CShape() {
	}

	~CShape() {
	}

	virtual double GetArea() = 0;
	virtual double GetPerimeter() = 0;

public:
	static double PI;
};
double CShape::PI = 3.14159265;

class CRectangle :public CShape {
public:
	CRectangle(double length, double width) :length(length), width(width) {}

	~CRectangle() {
	}

	double GetArea() {
		return length * width;
	}

	double GetPerimeter() {
		return length * 2 + width * 2;
	}

private:
	double length;
	double width;
};

class CCircle :public CShape {
public:
	CCircle(double r) : r(r) {}

	~CCircle() {
	}

	double GetArea() {
		return PI * r*r;
	}

	double GetPerimeter() {
		return 2 * PI*r;
	}

private:
	double r;
};

int main() {
	CShape *cs1 = new CRectangle(2, 3);
	CShape *cs2 = new CCircle(2);
	cout << cs1->GetArea() << ", " << cs1->GetPerimeter() << "\n";
	cout << cs2->GetArea() << ", " << cs2->GetPerimeter();
	cout << endl;
	return 0;
}